package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcSchoolBook;
import com.visizen.wisdomclass.server.model.WcSchoolBookExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcSchoolBookMapper {
    @SelectProvider(type=WcSchoolBookSqlProvider.class, method="countByExample")
    int countByExample(WcSchoolBookExample example);

    @DeleteProvider(type=WcSchoolBookSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcSchoolBookExample example);

    @Delete({
        "delete from wc_school_book",
        "where ADRR_ID = #{ADRR_ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long ADRR_ID);

    @Insert({
        "insert into wc_school_book (ADRR_ID, CLASS_ID, ",
        "NAME, PHONE_NO, ",
        "ATTACH_ID)",
        "values (#{ADRR_ID,jdbcType=BIGINT}, #{CLASS_ID,jdbcType=BIGINT}, ",
        "#{NAME,jdbcType=VARCHAR}, #{PHONE_NO,jdbcType=VARCHAR}, ",
        "#{ATTACH_ID,jdbcType=VARCHAR})"
    })
    int insert(WcSchoolBook record);

    @InsertProvider(type=WcSchoolBookSqlProvider.class, method="insertSelective")
    int insertSelective(WcSchoolBook record);

    @SelectProvider(type=WcSchoolBookSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ADRR_ID", property="ADRR_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="CLASS_ID", property="CLASS_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="NAME", property="NAME", jdbcType=JdbcType.VARCHAR),
        @Result(column="PHONE_NO", property="PHONE_NO", jdbcType=JdbcType.VARCHAR),
        @Result(column="ATTACH_ID", property="ATTACH_ID", jdbcType=JdbcType.VARCHAR)
    })
    List<WcSchoolBook> selectByExample(WcSchoolBookExample example);

    @Select({
        "select",
        "ADRR_ID, CLASS_ID, NAME, PHONE_NO, ATTACH_ID",
        "from wc_school_book",
        "where ADRR_ID = #{ADRR_ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="ADRR_ID", property="ADRR_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="CLASS_ID", property="CLASS_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="NAME", property="NAME", jdbcType=JdbcType.VARCHAR),
        @Result(column="PHONE_NO", property="PHONE_NO", jdbcType=JdbcType.VARCHAR),
        @Result(column="ATTACH_ID", property="ATTACH_ID", jdbcType=JdbcType.VARCHAR)
    })
    WcSchoolBook selectByPrimaryKey(Long ADRR_ID);

    @UpdateProvider(type=WcSchoolBookSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcSchoolBook record, @Param("example") WcSchoolBookExample example);

    @UpdateProvider(type=WcSchoolBookSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcSchoolBook record, @Param("example") WcSchoolBookExample example);

    @UpdateProvider(type=WcSchoolBookSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcSchoolBook record);

    @Update({
        "update wc_school_book",
        "set CLASS_ID = #{CLASS_ID,jdbcType=BIGINT},",
          "NAME = #{NAME,jdbcType=VARCHAR},",
          "PHONE_NO = #{PHONE_NO,jdbcType=VARCHAR},",
          "ATTACH_ID = #{ATTACH_ID,jdbcType=VARCHAR}",
        "where ADRR_ID = #{ADRR_ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcSchoolBook record);
}